Leadtools.ColorConversion Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.5.7
IccProfileExtended Constructor(IccHeader,IccTagList,Byte[],Byte[])
See Also  Example
Leadtools.ColorConversion Namespace > IccProfileExtended Class > IccProfileExtended Constructor : IccProfileExtended Constructor(IccHeader,IccTagList,Byte[],Byte[])




header
IccHeader class that has all the ICC header's data.
tagList
IccTagList class that contains information and data about all the tags in the ICC profile.
tagData
Array that contains all the tags data.
data
Array that contains all the ICC profile's data.
Initializes a new IccProfileExtended with explicit parameters.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal header As IccHeader, _
   ByVal tagList As IccTagList, _
   ByVal tagData() As Byte, _
   ByVal data() As Byte _
)
Visual Basic (Usage)Copy Code
Dim header As IccHeader
Dim tagList As IccTagList
Dim tagData() As Byte
Dim data() As Byte
 
Dim instance As IccProfileExtended(header, tagList, tagData, data)
C# 
public IccProfileExtended( 
   IccHeader header,
   IccTagList tagList,
   byte[] tagData,
   byte[] data
)
Managed Extensions for C++ 
public: IccProfileExtended( 
   IccHeader header,
   IccTagList tagList,
   byte[]* tagData,
   byte[]* data
)
C++/CLI 
public:
IccProfileExtended( 
   IccHeader header,
   IccTagList tagList,
   array<byte>^ tagData,
   array<byte>^ data
)

Parameters

header
IccHeader class that has all the ICC header's data.
tagList
IccTagList class that contains information and data about all the tags in the ICC profile.
tagData
Array that contains all the tags data.
data
Array that contains all the ICC profile's data.

Example

In this example, we will create an ICC header, and then load ICC tags list and ICC tags data from another profile, and create our own profile out of them.

Visual BasicCopy Code
Public Sub IccProfileExtendedConstructorExample()
   ' load an Icc Profile
   Dim iccProfile As New IccProfileExtended("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ICCv42.icc")

   ' create the new header
   Dim header As IccHeader = IccHeader.Empty

   header.CmmID = &H6170706C
   header.DeviceClass = IccProfileClassType.DeviceLinkClass
   header.ColorSpace = IccColorspaceType.LabData
   header.Pcs = IccColorspaceType.LabData
   header.ProfileSignature = &H61637370
   header.Platform = IccPlatformSignatureType.MacintoshSignature
   header.Flags = IccProfileFlags.None
   header.Manufacturer = &H46464549
   header.Model = 0
   header.Attributes = IccProfileMediaFlags.ColorMedia
   header.RenderingIntent = IccRenderingIntentType.AbsoluteColorimetric
   header.Creator = &H46464549

   ' set the system date/time as the date/time of the Icc Profile
   Dim sysDateTime As System.DateTime = System.DateTime.Now
   Dim iccDateTime As New IccDateTime(CUShort(sysDateTime.Year), _
         CUShort(sysDateTime.Month), _
         CUShort(sysDateTime.Day), _
         CUShort(sysDateTime.Hour), _
         CUShort(sysDateTime.Minute), _
         CUShort(sysDateTime.Second))

   header.DateTime = iccDateTime

   ' copy the tag data
   Dim counter, numberOfTags As Integer

   numberOfTags = iccProfile.TagList.Tags.Length
   Dim tags(numberOfTags - 1) As IccTag

   For counter = 0 To (numberOfTags - 1)
      tags(counter) = New IccTag(iccProfile.TagList.Tags(counter).Signature, _
         iccProfile.TagList.Tags(counter).Offset, _
         iccProfile.TagList.Tags(counter).Size)
   Next counter

   Dim tagsList As New IccTagList(tags)

   ' copy the tag data
   Dim tagData(iccProfile.TagData.Length - 1) As Byte
   iccProfile.TagData.CopyTo(tagData, 0)

   ' create the new ICC profile, the Data array parameter will not be passed, because it will be
   ' updated when calling UpdateDataArray() method.
   Dim newIccProfile As New IccProfileExtended(header, tagsList, tagData, Nothing)

   ' generate the profileId. For the time being, it will be filled with 0's
   newIccProfile.GenerateProfileId()

   ' finally generate the new Icc Profile by updating the Data Array
   ' and then generating the file
   newIccProfile.UpdateDataArray()
   newIccProfile.GenerateIccFile("C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileExtendedConstructorVB.icc")
End Sub
C#Copy Code
public void IccProfileExtendedConstructorExample() 

   // load an Icc Profile 
   IccProfileExtended iccProfile = new IccProfileExtended(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\ICCv42.icc"); 
 
   // create the new header 
   IccHeader header = IccHeader.Empty; 
 
   header.CmmID = 0x6170706C;     // any CMM ID 
   header.DeviceClass = IccProfileClassType.DeviceLinkClass; 
   header.ColorSpace = IccColorspaceType.LabData; 
   header.Pcs = IccColorspaceType.LabData; 
   header.ProfileSignature = 0x61637370;   // any profile signature 
   header.Platform = IccPlatformSignatureType.MacintoshSignature; 
   header.Flags = IccProfileFlags.None; 
   header.Manufacturer = 0x46464549;       // any manufacturer 
   header.Model = 0x0;   // any model 
   header.Attributes = IccProfileMediaFlags.ColorMedia; 
   header.RenderingIntent = IccRenderingIntentType.AbsoluteColorimetric; 
   header.Creator = 0x46464549;   // any creator 
 
   // set the system date/time as the date/time of the Icc Profile 
   System.DateTime sysDateTime = System.DateTime.Now; 
   IccDateTime iccDateTime = new IccDateTime((ushort)sysDateTime.Year, 
      (ushort)sysDateTime.Month, 
      (ushort)sysDateTime.Day, 
      (ushort)sysDateTime.Hour, 
      (ushort)sysDateTime.Minute, 
      (ushort)sysDateTime.Second); 
 
   header.DateTime = iccDateTime; 
 
   // copy the tag list 
   int counter, numberOfTags; 
 
   numberOfTags = iccProfile.TagList.Tags.Length; 
   IccTag[] tags = new IccTag[numberOfTags]; 
 
   for (counter = 0; counter < numberOfTags; counter++) 
   { 
      tags[counter] = new IccTag(iccProfile.TagList.Tags[counter].Signature, 
         iccProfile.TagList.Tags[counter].Offset, 
         iccProfile.TagList.Tags[counter].Size); 
   } 
 
   IccTagList tagList = new IccTagList(tags); 
 
   // copy the tag data 
   byte[] tagData = new byte[iccProfile.TagData.Length]; 
   iccProfile.TagData.CopyTo(tagData, 0); 
 
   // create the new ICC profile, the Data array parameter will not be passed, because it will be  
   // updated when calling UpdateDataArray() method. 
   IccProfileExtended newIccProfile = new IccProfileExtended(header, tagList, tagData, null); 
 
   // generate the profileId. For the time being, it will be filled with 0's 
   newIccProfile.GenerateProfileId(); 
 
   // finally generate the new Icc Profile by updating the Data Array 
   // and then generating the file 
   newIccProfile.UpdateDataArray(); 
   newIccProfile.GenerateIccFile(@"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\IccProfileExtendedConstructorCS.icc"); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also